{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 一.简介\n",
    "这一章开始EM算法的探索，EM即Expectation Maximization，称为期望极大算法；如果直接介绍EM算法会有些云里雾里，所以这一节会先介绍GMM（Gaussian mixture model,高斯混合模型），然后由此引出EM算法的求解，我们首先看看单个的高斯模型求解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二.单个高斯分布\n",
    "\n",
    "假如，我们有如下的一堆一维数据点，并且知道它iid采样于某一一维高斯分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-0.1, 1)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEYxJREFUeJzt3X+sZGddx/H3p3e3UAu21F4UdhdayQKWH9pyUyo1WgOk2ypdUJRdRZEQG5X6I5omRUnRotHQP1SSIjZI+BFpqfyoG7K4EsVggJbeUii0dXVZfuxlTbpSqD+otlu+/jGzZfbu3J0ze+fO3D68X8nNnvOcZ57z3SfPfnrmnJnbVBWSpLacNOsCJEmTZ7hLUoMMd0lqkOEuSQ0y3CWpQYa7JDVoZLgneXuSe5N8foXjSfLmJPuS3JnkvMmXKUkaR5cr93cA245z/BJga//ncuAvVl+WJGk1RoZ7VX0MuO84XbYD76qeW4DTkzxpUgVKksa3YQJjbAIODOwv9dv+fXnH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T/UNXX0W7K1rOlqevfP3tJ7RsLh6v32t++l9xYNegv+PVX1d5OoqWNdLwd+Nclh4AFgR/VW1OEkVwB76H2y4e1VddcU6wJ4GfD3VfU/Ay9dy/m6EPgF4HP9e6MAv0svOGe2tjrWNYv11aWuaa+vLjXB9NfWk4B3Jpmjd0fkpqr6UJJrgMWq2gX8FfDuJPvo/YdnR7/mu5LcBNwNHAZeW71bPKvirx+QpAY9Wu+5S5KOw3CXpAYZ7pLUIMNdkhpkuEtSgwx3SWqQ4S5JDfp/oxsCIhpLT8cAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data=np.sort(np.linspace(1,3,15).tolist()+np.linspace(1.5,2,15).tolist())\n",
    "plt.scatter(data,[0]*len(data))\n",
    "plt.ylim(-0.1,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们知道一维高斯分布的概率密度函数如下：   \n",
    "\n",
    "$$\n",
    "N(x\\mid u,\\sigma)=\\frac{1}{\\sqrt{2\\pi}\\cdot\\sigma}exp(-\\frac{(x-u)^2}{2\\sigma^2})\n",
    "$$\n",
    "\n",
    "那么该如何求该高斯分布参数呢？即估计高斯参数$u,\\sigma$，极大似然估计便是一种常用的方法\n",
    "#### 极大似然估计\n",
    "\n",
    "极大似然估计是一种点估计，它目标函数即似然函数，如下：   \n",
    "\n",
    "$$\n",
    "L(u,\\sigma)=\\prod_{i=1}^MN(x_i\\mid u,\\sigma)\n",
    "$$\n",
    "\n",
    "$M$表示样本量，我们要求解：  \n",
    "\n",
    "$$\n",
    "u^*,\\sigma^*=arg\\max_{u,\\sigma}L(u,\\sigma)\n",
    "$$  \n",
    "\n",
    "可以简单的理解为让样本出现的概率尽可能的大，由于累乘不好计算，通常会对似然函数取对数，将乘号变为加号，这时的目标函数表示如下：   \n",
    "\n",
    "$$\n",
    "L(u,\\sigma)=log(\\prod_{i=1}^Mp(x_i\\mid u,\\sigma))=-Mlog(\\sqrt{2\\pi}\\cdot\\sigma)-\\sum_{i=1}^M\\frac{(x-u)^2}{2\\sigma^2}\n",
    "$$  \n",
    "\n",
    "显然取对数后的最优解和取对数前一致，由于极值点必然是导数为0的点，所以，我们分别让$L(u,\\sigma)$对$u,\\sigma$求偏导，并令其为0，即可得到$u^*,\\sigma^*$：  \n",
    "\n",
    "$$\n",
    "\\frac{\\partial L(u,\\sigma)}{\\partial u}=\\frac{1}{\\sigma^2}\\sum_{i=1}^M(x_i-u)=0\\Rightarrow u^*=\\frac{\\sum_{i=1}^Mx_i}{M}\n",
    "$$\n",
    "\n",
    "$$\n",
    "\\frac{\\partial L(u,\\sigma)}{\\partial \\sigma}=-M\\frac{1}{\\sigma}+\\sum_{i=1}^M(x-u)^2\\sigma^{-3}=0\\Rightarrow\\sigma^*=\\sqrt{\\frac{\\sum_{i=1}^M(x-u^*)^2}{M}}\n",
    "$$\n",
    "\n",
    "结果非常简单且好理解，对于上面的伪数据，我们可以很方便的求解出其高斯分布的参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#定义一维高斯概率分布函数\n",
    "def gaussian_1d(x,u,sigma):\n",
    "    return 1/(np.sqrt(2*np.pi)*sigma)*np.exp(-1*np.power(x-u,2)/(2*sigma**2))\n",
    "u=np.mean(data)\n",
    "sigma=np.std(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-0.1, 1)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHR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sm3LyVxWbF/O5PL09uVMJvD8ttUE+IeI2LAfEVlkjPlMRKYCKcaYZcA7wFwRycT+P55kR+atIrIISANKgLuN/RBPjejtB5RSyg/56jF3pZRSF6DlrpRSfkjLXSml/JCWu1JK+SEtd6WU8kNa7kop5Ye03JVSyg/9P2ISQi59VZ+aAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(data,[0]*len(data))\n",
    "plt.plot(data,gaussian_1d(data,u,sigma))\n",
    "plt.ylim(-0.1,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二.多个高斯分布\n",
    "可以发现结果比较make sense，数据密集的地方，对应的概率密度也很高，接着我们再造一些数据看看，比如下面，这部分数据明显可以分为两部分，中间有隔断，如果再用一个高斯分布去拟合，其结果就有些牵强了,概率分布高的地方零星只有几个点的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-0.1, 1)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGBhJREFUeJzt3X1wJPdd5/HPVzOjp9GsVg+jtS1pn9d2fCEpxyIkuADngbKTo2zggNhXuQtUChcFAe5ImXKACilfXSVFru7g6gycK5cLcFyME1Jhi1pwDsdUqFQcLOPEiXfteL27trRP0q72Qc+rh+/90TPSaHakaY1mNNqf3q8qlfrh191ftVqf6flNd8vcXQCAsDTUuwAAQPUR7gAQIMIdAAJEuANAgA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3LFpGU9A5Jf+Lud0qaVI3edm91ub7kByTtk3SLpLSZfbi+VW0fhHuFzCylKNj/0t2/Uu966uhuSfeb2SlJT0p6r5n9n/qWVFfDkobdPf9O7suKwn47er+kk+4+6u5zkr4i6UfrXNNWcN7Mbpak3PeRWmyEcK+AmZmiPtVj7v5f611PPbn7J9y9z933Kvqw7Ovuvm3Pztz9nKQhM7stN+l9ko7WsaR6elPSu8ysNfc38z5t0w+XixyW9JHc8Eck/U0tNpKsxUq3gbsl/TtJ3zOz7+Sm/Y67H6ljTdg6fl3SX5pZo6QTkn6pzvXUhbt/28y+LOlfFF1h9qK22WMIzOyLku6R1G1mw5J+X9JnJD1lZh9V9AL48zXZNo8fAIDw0C0DAAEi3AEgQIQ7AASIcAeAABHuABAgwh0AAkS4A0CA/j+1cdTZbGihCwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data1=sorted(np.linspace(1,3,10).tolist()+np.linspace(1.5,2,10).tolist())\n",
    "data2=sorted(np.linspace(5,10,10).tolist()+np.linspace(6.5,8.5,10).tolist())\n",
    "u=np.mean(data1+data2)\n",
    "sigma=np.std(data1+data2)\n",
    "plt.scatter(data1+data2,[0]*len(data1+data2))\n",
    "plt.plot(data1+data2,gaussian_1d(data1+data2,u,sigma))\n",
    "plt.ylim(-0.1,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "既然一个高斯分布不能很好的拟合这些数据，那就多个去拟合？这便是**高斯混合模型**，我们分别构建两个高斯分布去拟合左右两侧的数据看看效果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-0.1, 1)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VPW9//HXJ5OFrIRANkIggEkAUQSCslyt+0J73Soq7q2KWLdar/en7f319uft7aK9t9Ve1OLeUhdcarmWSutWFxaJoIiQBcKSBLIQSMieTOb7+yMzGGOWSTIzZ+bM5/l4+DBz5iyfHCbvc+Z7vud7xBiDUkope4mwugCllFK+p+GulFI2pOGulFI2pOGulFI2pOGulFI2pOGulFI2NGi4i8jTIlIjItv7eV9E5BER2SUi20Rkju/LVEopNRTenLk/C5w/wPsXALnu/5YBj428LKWUUiMxaLgbY94HDg8wy0XA7023jUCyiGT6qkCllFJDF+mDdWQB5T1eV7inHew9o4gso/vsnvj4+LnTpk3zweaVUip8fPLJJ4eMMamDzeeLcJc+pvU5poExZiWwEqCgoMAUFhb6YPNKKRU+RGSfN/P5ordMBZDd4/UE4IAP1quUUmqYfBHua4Dr3L1m5gMNxpivNckopZQKnEGbZUTkBeB0YJyIVAD/DkQBGGMeB9YCi4FdQAvwHX8Vq5RSyjuDhrsxZukg7xvgNp9VpJRSasT0DlWllLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXellLIhDXcv1TW182HpIdo6u6wuRSmlBhVpdQHBrqXDyfJVW/igtBZjYPbEZJ64roBxCTFWl6aUUv3SM/dB/GztTj4oreW204/jpxfPZOfBo1z66HoONbVbXZpSSvVLw30A7xbVsGrjfm76p8n8y3n5XDN/En+8aT4VR1p4/L3dVpenlFL98ircReR8ESkWkV0icl8f708UkXdFZKuIbBORxb4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gozujy/pvvgq3R9fCsi+0DZ3pZSyIT1zV0opG9JwV0opG9JwHwYRyRaRd0Vkp4h8ISJ3WV2T1UTEISJbReQNq2uxmogki8grIlLk/owssLomq4jI3e6/ke0i8oKIjLK6pkASkadFpEZEtveYliIifxeRUvf/x/hj2xruw+ME7jHGTAfmA7eJyAyLa7LaXcBOq4sIEg8DbxpjpgGzCNP9IiJZwJ1AgTFmJuAArrS2qoB7Fji/17T7gLeNMbnA2+7XPqfhPgzGmIPGmC3unxvp/uPNsrYq64jIBOCbwJNW12I1EUkCTgOeAjDGdBhj6q2tylKRQKyIRAJxwAGL6wkoY8z7wOFeky8CnnP//BxwsT+2reE+QiKSA8wGNllbiaV+A/wr4LK6kCAwBagFnnE3Uz0pIvFWF2UFY0wl8CtgP3AQaDDG/M3aqoJCujHmIHSfKAJp/tiIhvsIiEgC8CrwfWPMUavrsYKIfAuoMcZ8YnUtQSISmAM8ZoyZDTTjp6/dwc7dlnwRMBkYD8SLyDXWVhU+NNyHSUSi6A72PxpjXrO6HgstAi4Ukb3Ai8CZIrLK2pIsVQFUGGM83+ReoTvsw9HZwB5jTK0xphN4DVhocU3BoFpEMgHc/6/xx0Y03IdBRITuNtWdxpj/troeKxlj7jfGTDDG5NB9sewdY0zYnp0ZY6qAchHJd086C9hhYUlW2g/MF5E499/MWYTpxeVe1gDXu3++HvizPzYS6Y+VhoFFwLXA5yLyqXvaD40xay2sSQWPO4A/ikg0UAZ8x+J6LGGM2SQirwBb6O5htpUwG4ZARF4ATgfGiUgF8O/AL4DVInIj3QfAJX7Ztg4/oJRS9qPNMkopZUMa7kopZUMa7kopZUMa7kopZUMa7kopZUMa7kopZUMa7kopZUP/H7KjrTm3KbSuAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data1=sorted(np.linspace(1,3,10).tolist()+np.linspace(1.5,2,10).tolist())\n",
    "data2=sorted(np.linspace(5,10,10).tolist()+np.linspace(6.5,8.5,10).tolist())\n",
    "u1=np.mean(data1)\n",
    "u2=np.mean(data2)\n",
    "sigma1=np.std(data1)\n",
    "sigma2=np.std(data2)\n",
    "plt.scatter(data1+data2,[0]*len(data1+data2))\n",
    "plt.plot(data1+data2,gaussian_1d(data1+data2,u1,sigma1)+gaussian_1d(data1+data2,u2,sigma2))\n",
    "plt.ylim(-0.1,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "nice,该凸的地方凸了,该凹的地方凹了，但这里还有一个问题，如果对该概率分布做积分，其结果为2，因为包含了两个高斯分布，每个高斯分布的积分都为1，所以我们还需要对每个高斯分布的权重进行约束，假设$\\alpha_1$为第一个高斯分布的权重，$\\alpha_2$为第二个高斯分布的权重，那么，需要满足如下约束：  \n",
    "\n",
    "$$\n",
    "\\alpha_1+\\alpha_2=1,\\alpha_1\\geq 0,\\alpha_2\\geq 0\n",
    "$$  \n",
    "\n",
    "我们不妨假设$\\alpha_1=0.5,\\alpha_2=0.5$，所以一个比较合理的分布如下：  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-0.1, 1)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt4VfWd7/H3NzcI4U4CgSTcwx0RjMhFFLUWRMVbW7HWaqfq9GbnzHQ8R+ec0/F02mc67TzT6cxjbaltFdtqvUuRqvUOAkoABQExAQJJCBDCHUKu3/NHEowxl52wd3ay9uf1PDzsvdZv/d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z9M9bCZpUS7qGhw92Lg34G9QAlwzN1fiW5VXcIQdy+Buh1FYHAkVqJwPwdm1ht4Bvgf7n482vVEg5ldAxx09w3RrqWLSABmAA+5+3TgFBH6s7urqx9Lvg4YBQwDUszsK9GtKnYo3DvIzBKpC/Y/uPuz0a4niuYCi82sAHgCuNzMfh/dkqKqCChy94a/5J6mLuxj0eeA3e5e6u5VwLPAnCjX1BUcMLOhAPX/H4zEShTuHWBmRt2Y6nZ3/49o1xNN7n6/u2e6+0jqDpa97u4xu3fm7vuBQjMbXz/pCmBbFEuKpr3ALDPrVf87cwUxenC5ieXA7fWPbwdeiMRKEiLRaQyYC9wGbDGz9+un/ZO7r4xiTdJ13AP8wcySgF3A16JcT1S4+7tm9jSwkbozzDYRY7chMLPHgflAqpkVAf8M/Bh40sy+Tt0H4Bcjsm7dfkBEJHg0LCMiEkAKdxGRAFK4i4gEkMJdRCSAFO4iIgGkcBcRCSCFu4hIAP1/1MJzNjXBn3IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "alpha1=0.5\n",
    "alpha2=0.5\n",
    "plt.scatter(data1+data2,[0]*len(data1+data2))\n",
    "plt.plot(data1+data2,alpha1*gaussian_1d(data1+data2,u1,sigma1)+alpha2*gaussian_1d(data1+data2,u2,sigma2))\n",
    "plt.ylim(-0.1,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "到这里，我们通过两个高斯分布去模拟数据的概率分布，并取得了看起来不错的效果，但整个过程都是靠“人”的先验知识去完成的，比如（1）通过观测数据的分布，人为的选择了两个高斯分布；（2）一个高斯分布只去学习左侧数据，另一个高斯分布只去学习右侧的数据；（3）人为的为每个高斯分布的权重设置为0.5，但我们更加希望这个过程是能自动完成的，即自动去学习参数$\\theta=\\{u_1,\\sigma_1,u_2,\\sigma_2,\\alpha_1\\}$，所以让我们从头开始，假设，现在的高斯混合模型为：   \n",
    "\n",
    "$$\n",
    "P(x\\mid\\theta)=\\alpha_1N_1(x\\mid u_1,\\sigma_1)+(1-\\alpha_1)N_2(x\\mid u_2,\\sigma_2)=\\sum_{i=1}^2\\alpha_iN_i(x\\mid u_i,\\sigma_i),\\alpha_2=1-\\alpha_1\n",
    "$$  \n",
    "\n",
    "对这些参数的求解，我们同样可以使用最大对数似然估计的方式，所以，损失函数：   \n",
    "\n",
    "$$\n",
    "L(\\theta)=log(\\prod_{i=1}^MP(x_i\\mid \\theta))=\\sum_{i=1}^MlogP(x_i\\mid \\theta)=\\sum_{i=1}^Mlog[\\sum_{k=1}^2\\alpha_kN_k(x_i\\mid u_k,\\sigma_k)]\n",
    "$$  \n",
    "\n",
    "接下来，按之前的思路，我们分别对各个参数求偏导并令其为0，不是就可以解出最优参数了？可问题是现在很难解...,不信，那下面推导一下损失函数$L(\\theta)$对$u_k$的偏导（$k=1,2$）：   \n",
    "\n",
    "$$\n",
    "\\frac{\\partial L(\\theta)}{\\partial u_k}=\\sum_{i=1}^M\\frac{\\frac{\\alpha_k(x_i-u_k)}{\\sqrt{2\\pi}\\sigma_k^3}exp(-\\frac{(x_i-u_k)^2}{2\\sigma_k^2})}{\\sum_{j=1}^2\\alpha_jN_j(x_i\\mid u_j,\\sigma_j)}=0 \\Rightarrow 谁能直接算出来，请联系我\n",
    "$$  \n",
    "\n",
    "所以，需要转换一种思路去求解，EM是一种迭代逐步优化的思路，它主要分为两步，第一步求期望(E)，第二步对其求极大化(M)，重复执行这两步，直到收敛，即找到一组$\\theta^1->\\theta^2->,...,->\\theta^i$使得$L(\\theta^1)<L(\\theta^2)<\\cdots<L(\\theta^i)$，接下来，在下一节介绍EM算法流程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
